<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!--<kd-resource-card object-meta="::$ctrl.rolebinding.objectMeta"
                  type-meta="::$ctrl.rolebinding.typeMeta">
  <kd-resource-card-status layout="row">
    <md-icon class="material-icons kd-error"
             ng-if="::$ctrl.isFailed()">
      error
      <md-tooltip md-delay="500"
                  md-autohide>
        [[This rolebinding has errors.|Tooltip for failed rolebinding card icon]]
      </md-tooltip>
    </md-icon>
    <md-icon class="material-icons"
             ng-if="::$ctrl.isPending()">
      timelapse
      <md-tooltip md-delay="500"
                  md-autohide>
        [[This rolebinding is in a pending state.|Tooltip for pending rolebinding card icon]]
      </md-tooltip>
    </md-icon>
    <md-icon class="material-icons kd-success"
             ng-if="::$ctrl.isSuccess()">
      check_circle
    </md-icon>
  </kd-resource-card-status>-->
  <!--<kd-resource-card-columns>
    <kd-resource-card-column>
      <div>
        <a ng-href="{{::$ctrl.getRolebindingDetailHref()}}"
           class="kd-middle-ellipsised-link">
          <kd-middle-ellipsis display-string="{{::$ctrl.rolebinding.objectMeta.name}}">
          </kd-middle-ellipsis>
        </a>
      </div>
    </kd-resource-card-column>
    <kd-resource-card-column ng-if="::$ctrl.areMultipleNamespacesSelected()">
      <div>
        <kd-middle-ellipsis display-string="{{::$ctrl.rolebinding.objectMeta.namespace}}">
        </kd-middle-ellipsis>
      </div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <kd-labels labels="::$ctrl.rolebinding.objectMeta.labels"></kd-labels>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <span class="kd-replicase-card-pods-stat">
        {{::$ctrl.rolebinding.pods.running}} /
        {{::$ctrl.rolebinding.pods.desired}}
      </span>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <div ng-if="::$ctrl.rolebinding.objectMeta.creationTimestamp">
        {{::$ctrl.rolebinding.objectMeta.creationTimestamp | relativeTime}}
        <md-tooltip md-delay="500"
                    md-autohide>
          [[Started at | Tooltip for the age column ]] {{::$ctrl.rolebinding.objectMeta.creationTimestamp | date}}
        </md-tooltip>
      </div>
      <div ng-if="::!$ctrl.rolebinding.objectMeta.creationTimestamp">-</div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      {{::$ctrl.rolebinding.containerImages}}
    </kd-resource-card-column>
    <kd-resource-card-column ng-if="::$ctrl.showMetrics">
      <div ng-if="::$ctrl.hasCpuUsage(rolebinding)">
        <kd-sparkline timeseries="::$ctrl.rolebinding.metrics.cpuUsageHistory"
                      class="kd-sparkline-cpu-series"></kd-sparkline>
        {{::($ctrl.rolebinding.metrics.cpuUsage | kdCores)}}
      </div>
      <div ng-if="::!$ctrl.hasCpuUsage(rolebinding)">-</div>
    </kd-resource-card-column>
    <kd-resource-card-column ng-if="::$ctrl.showMetrics">
      <div ng-if="::$ctrl.hasMemoryUsage()">
        <kd-sparkline timeseries="::$ctrl.rolebinding.metrics.memoryUsageHistory"
                      class="kd-sparkline-memory-series"></kd-sparkline>
        {{::($ctrl.rolebinding.metrics.memoryUsage | kdMemory)}}
      </div>
      <div ng-if="::!$ctrl.hasMemoryUsage()">-</div>
    </kd-resource-card-column>-->
    <!--<kd-resource-card-column class="kd-row-layout-column kd-icon-column">
      <kd-logs-button object-meta="::$ctrl.rolebinding.objectMeta"
                      resource-kind-name="::$ctrl.rolebinding.typeMeta.kind">
      </kd-logs-button>
      <kd-resource-card-menu>
        <kd-resource-card-delete-menu-item resource-kind-name="[[Rolebinding|Name of the rolebinding resource]]">
        </kd-resource-card-delete-menu-item>
        <kd-resource-card-edit-menu-item resource-kind-name="[[Rolebinding|Name of the rolebinding resource]]">
        </kd-resource-card-edit-menu-item>
      </kd-resource-card-menu>
    </kd-resource-card-column>-->
  <!--</kd-resource-card-columns>-->
  <!--<kd-resource-card-footer ng-if="::$ctrl.isFailed()">
    <kd-rolebinding-warnings warnings="::$ctrl.rolebinding.warnings"></kd-rolebinding-warnings>
  </kd-resource-card-footer>
</kd-resource-card>-->
<kd-resource-card type-meta="$ctrl.rolebinding.typeMeta"
                  object-meta="$ctrl.rolebinding.objectMeta">
  <kd-resource-card-status layout="row">
    <md-icon class="material-icons kd-error"
             ng-if="::$ctrl.hasWarnings()">
      error
      <md-tooltip md-delay="500"
                  md-autohide>
        [[One or more pods have errors|Tooltip saying that some pods in a rolebinding have errors.]]
      </md-tooltip>
    </md-icon>
    <md-icon class="material-icons"
             ng-if="::$ctrl.isPending()">
      timelapse
      <md-tooltip md-delay="500"
                  md-autohide>
        [[One or more pods are in pending state|Tooltip saying that some pods in a rolebinding are pending.]]
      </md-tooltip>
    </md-icon>
    <md-icon class="material-icons kd-success"
             ng-if="::$ctrl.isSuccess()">
      check_circle
    </md-icon>
  </kd-resource-card-status>
  <kd-resource-card-columns>
    <kd-resource-card-column>
      <div>
        <a ng-href="{{::$ctrl.getDeploymentDetailHref()}}"
           style="display: block;">
          <kd-middle-ellipsis display-string="{{$ctrl.rolebinding.objectMeta.name}}">
          </kd-middle-ellipsis>
        </a>
      </div>
    </kd-resource-card-column>
    <kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
      <div>
        <kd-middle-ellipsis display-string="{{::$ctrl.rolebinding.objectMeta.namespace}}">
        </kd-middle-ellipsis>
      </div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <kd-labels labels="::$ctrl.rolebinding.objectMeta.labels"></kd-labels>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <span class="kd-replicase-card-pods-stat">
        {{::$ctrl.rolebinding.pods.running}} /
        {{::$ctrl.rolebinding.pods.desired}}
      </span>
    </kd-resource-card-column>
    <kd-resource-card-column>
      {{::$ctrl.rolebinding.objectMeta.creationTimestamp | relativeTime}}
      <md-tooltip md-delay="500"
                  md-autohide>
        [[Created at| Tooltip for the age column ]] {{::$ctrl.rolebinding.objectMeta.creationTimestamp | date}}
      </md-tooltip>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <div ng-repeat="image in ::$ctrl.rolebinding.containerImages track by $index">
        <kd-middle-ellipsis display-string="{{::image}}"></kd-middle-ellipsis>
      </div>
      <div ng-repeat="image in ::$ctrl.rolebinding.initContainerImages track by $index">
        <kd-middle-ellipsis display-string="{{::image}}"></kd-middle-ellipsis>
      </div>
    </kd-resource-card-column>
    <kd-resource-card-column class="kd-row-layout-column kd-icon-column">
      <kd-resource-card-menu>
        <kd-scale-button resource-kind-display-name="[[Deployment|Label 'Deployment' which will appear in the rolebinding scale dialog opened from a rolebinding card on the list page.]]"
                         resource-kind-name="$ctrl.rolebinding.typeMeta.kind"
                         object-meta="$ctrl.rolebinding.objectMeta"
                         current-pods="$ctrl.rolebinding.pods.current"
                         desired-pods="$ctrl.rolebinding.pods.desired"
                         menu-item="true">
        </kd-scale-button>
        <kd-resource-card-delete-menu-item resource-kind-name="[[Deployment|Label 'Deployment' which will appear in the rolebinding delete dialog opened from a rolebinding card on the list page.]]">
        </kd-resource-card-delete-menu-item>
        <kd-resource-card-edit-menu-item resource-kind-name="[[Deployment|Label 'Deployment' which will appear in the rolebinding edit dialog opened from a rolebinding card on the list page.]]">
        </kd-resource-card-edit-menu-item>
      </kd-resource-card-menu>
    </kd-resource-card-column>
  </kd-resource-card-columns>
  <kd-resource-card-footer ng-if="::$ctrl.hasWarnings()">
    <kd-pod-warnings warnings="::$ctrl.rolebinding.pods.warnings"></kd-pod-warnings>
  </kd-resource-card-footer>
</kd-resource-card>
